#include "bsp_exti.h"



/**
 * @brief NVIC配置
*/
void NVIC_Config(void) 
{
    NVIC_InitTypeDef NVIC_InitStructure;

    //配置按键1
    //NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);

    NVIC_InitStructure.NVIC_IRQChannel = KEY1_INT_EXTI_IRQ;

    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

    NVIC_INIT(&NVIC_InitStructure);

    //配置按键2
    NVIC_InitStructure.NVIC_IRQChannel = KEY2_INT_EXTI_IRQ;
    NVIC_INIT(&NVIC_InitStructure);
}



void EXTI_KEY_Config(void) 
{
    GPIO_InitTypeDef GPIO_InitStructure;
    EXTI_InitTypeDef EXTI_InitStructure;

    //开启GPIO口的时钟
    RCC_APB2PeriphclockCmd(KEY1_INT_GPIO_CLK, ENABLE);
    RCC_APB2PeriphclockCmd(KEY2_INT_GPIO_CLK, ENABLE);

    NVIC_Config();

    //配置KEY1 GPIO
    GPIO_InitStructure.GPIO_Pin = KEY1_INT_GPIO_PIN;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;  //浮空输入
    GPIO_INIT(KEY1_INT_GPIO_PORT, &GPIO_InitStructure);

    //配置KEY1 EXTI
    GPIO

}